#pragma once
#include "DiagnosticBag.hpp"
#include "Expression/Expression.hpp"
#include "Text/SourceText.hpp"
#include "Token.hpp"
#include "Parser.hpp"
#include "CompilationUnit.hpp"
class SyntaxTree;

// 定义类型;
typedef std::shared_ptr<SyntaxTree> SharedTree;

class SyntaxTree
{
public:
  SyntaxTree(SourceText &text);

public:
  static SharedTree Parse(std::string &text);
  static SharedTree Parse(SourceText &text);
  static SharedToken ParseTokens(std::string &text);
  static SharedToken ParseTokens(SourceText &text);

public:
  SourceText Text;
  SharedDiagnosticBag Diagnostics;
  SharedCompilationUnit Root;
};
